package week2;
public class Homework21{
    public static void main (String[] args) {
        int m = 1000,n = 495;
        int gcd;
        do{
            m %= n;
            if( m < n ) {
                int temp = n;
                n = m;
                m = temp;
            }
        }while(m % n == 0);
        gcd = n;
	System.out.printf("gcd(m,n)=%d%n",gcd);
    }
}
